<!DOCTYPE html>
<!--
This is a starter template page. Use this page to start your new project from
scratch. This page gets rid of all links and provides the needed markup only.
-->
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
          xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">

<head  th:replace="top::html">


  <title>修改资源</title>
</head>
<body class="fixed hold-transition skin-blue">
<div class="wrapper">

  <!-- Main Header -->


    <div th:replace="tophtml::html" ></div>
  <!-- Left side column. contains the logo and sidebar -->
  <div th:replace="left::html" ></div>
  
  <!-- Content Wrapper. Contains page content -->
  
  <div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
      <h1>
        Page Header
        <small>Optional description</small>
      </h1>
      <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> Level</a></li>
        <li class="active">Here</li>
      </ol>
    </section>

    <!-- Main content -->
    <section class="content container-fluid">

      <!--------------------------
        | Your Page Content Here |
        -------------------------->
        <form th:action="@{/permission/updatePermission}" method="post" th:object="${permission}">
        <input type="hidden" name="pid" th:value="${permission.pid}">
        <div class="form-group">
                  <label>资源名称</label>
                  <input type="text" class="form-control" placeholder="Enter ..." name="name" th:value="${permission.name}">
                  <p style="color: red;" th:if="${#fields.hasErrors('name')}" th:errors="*{name}">Error</p>
         </div>
          <div class="form-group">
                  <label>资源路径</label>
                  <input type="text" class="form-control" placeholder="Enter ..." name="url" th:value="${permission.url}">
                  <p style="color: red;" th:if="${#fields.hasErrors('url')}" th:errors="*{url}">Error</p>
                  
         </div>
         <div class="form-group">
                  <label>资源描述</label>
                  <input type="text" class="form-control" placeholder="Enter ..." name="description" th:value="${permission.description}">
                 
         </div>
         
            <div class="form-group">
                  <label>父菜单(不选默认功能)</label>
                  <select class="form-control" name="parentId">
                    <option value="-1">--菜单列表--</option>
                    <option  th:each="list:${menus}" th:value="${list.pid}" th:text="${list.name}" th:selected="${list.pid eq permission.parentId}" ></option>
                  </select>
   </div>  


<div class="box-footer">
                <button type="submit" class="btn btn-primary">修改</button>
</div>

</form>
    </section>
    <!-- /.content -->
  </div>
  <div th:replace="footer::html" ></div>

  <div class="control-sidebar-bg"></div>
</div>

<div th:replace="bottom::html" ></div>
</body>
</html>